package org.hefan.hrm.client;

import feign.hystrix.FallbackFactory;
import org.hefan.hrm.domain.LoginUser;
import org.hefan.hrm.util.AjaxResult;
import org.springframework.stereotype.Component;

@Component
public class LoginUserClientFallBackFactory implements FallbackFactory<LoginUserClient> {
    @Override
    public LoginUserClient create(Throwable throwable) {
        return new LoginUserClient() {
            @Override
            public AjaxResult addOrUpdate(LoginUser loginUser) {
                return AjaxResult.me().setSuccess(false).setMessage("系统维护中...");
            }
        };
    }
}
